package com.slz3.business.module.afterSaleManagement.aftApplyOrderLine.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.afterSaleManagement.aftApplyOrderLine.domain.AftApplyOrderLine;
import com.slz3.business.module.afterSaleManagement.aftApplyOrderLine.domain.AftApplyOrderLineCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class AftApplyOrderLineResController extends AftApplyOrderLineResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, AftApplyOrderLine aftApplyOrderLine) {
        if (AftApplyOrderLineResUnsafeValid.add(req, aftApplyOrderLine)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLine);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, AftApplyOrderLineCondition aftApplyOrderLineCondition) {
        if (AftApplyOrderLineResUnsafeValid.delete(req, aftApplyOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLineCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, AftApplyOrderLine aftApplyOrderLine) {
        if (AftApplyOrderLineResUnsafeValid.modify(req, aftApplyOrderLine)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLine);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (AftApplyOrderLineResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return aftApplyOrderLineResAtomic.info_$AftApplyOrderLineUpdateLock(req);
        if (AftApplyOrderLineResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$AftApplyOrderLineUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (AftApplyOrderLineResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> findBySerAfterSaleId(ServerRequest req) {
        if (AftApplyOrderLineResUnsafeValid.findBySerAfterSaleId(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.findBySerAfterSaleId(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, AftApplyOrderLineCondition aftApplyOrderLineCondition) {
        //
        if (AftApplyOrderLineResUnsafeValid.auditSubmit(req, aftApplyOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLineCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, AftApplyOrderLineCondition aftApplyOrderLineCondition) {
        if (AftApplyOrderLineResUnsafeValid.audit(req, aftApplyOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLineCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, AftApplyOrderLineCondition aftApplyOrderLineCondition) {
        if (AftApplyOrderLineResUnsafeValid.auditReject(req, aftApplyOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLineCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, AftApplyOrderLineCondition aftApplyOrderLineCondition) {
        if (AftApplyOrderLineResUnsafeValid.usingEnable(req, aftApplyOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLineCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, AftApplyOrderLineCondition aftApplyOrderLineCondition) {
        if (AftApplyOrderLineResUnsafeValid.usingDisable(req, aftApplyOrderLineCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$AftApplyOrderLineUpdateLock(req, aftApplyOrderLineCondition);
        }
    }

}
